From f9389e4d2c1fee87af3fb7bb81c2f58a2ca404d7 Mon Sep 17 00:00:00 2001 From: oliskoli Date: Fri, 5 Sep 2008 20:34:37 +0000 Subject: [PATCH] inifile: Check input file for unicode format. --- inifile.c | 3 +++ inifile.h | 1 + 2 files changed, 4 insertions(+) diff --git a/inifile.c b/inifile.c index 84ef67a79..d3b4fc923 100644 --- a/inifile.c +++ b/inifile.c @@ -139,10 +139,13 @@ inifile_load_file(gbfile *fin, inifile_t *inifile, const char *myname) { char *buf; inifile_section_t *sec = NULL; + int line = 0; while ((buf = gbfgetstr(fin))) { char *cin = lrtrim(buf); + + if ((line++ == 0) && fin->unicode) inifile->unicode = 1; if (*cin == '\0') continue; /* skip empty lines */ if ((*cin == '#') || (*cin == ';')) continue; /* skip comments */ diff --git a/inifile.h b/inifile.h index 560727732..e7fc8289f 100644 --- a/inifile.h +++ b/inifile.h @@ -27,6 +27,7 @@ typedef struct inifile_s { int isecs; /* number of sections */ queue secs; /* sections */ + gbuint8 unicode:1; } inifile_t; /* -- 2.30.2